import java.util.Arrays;

/**
* @description: 1033. 移动石子直到连续
* @author hewei
* @date 2022/10/6 15:53
* @version 1.0
*/

public class NumMovesStones {

    public int[] numMovesStones(int a, int b, int c) {
        int[] nums = {a, b, c};
        Arrays.sort(nums);
        int[] res = new int[2];
        if (nums[1] - nums[0] == 1 && nums[2] - nums[1] == 1) {
            res[0] = 0;
        } else {
            int min = Math.min(nums[1] - nums[0], nums[2] - nums[1]);
            if (min == 1 || min == 2) {
                res[0] = 1;
            } else res[0] = 2;
        }
        res[1] = nums[1] - nums[0] + nums[2] - nums[1] - 2;
        return res;
    }
}
